From 3e468e8ded561d30c1d2b3a76f437d5fff8a0dd5 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Mon, 9 Aug 2004 21:59:20 +0000 Subject: [PATCH] bitkeeper revision 1.1159.12.2 (4117f3b8rwM8OBu0SxwoWkvUXsjLTQ) add migration support to ngio frontend blk driver. --- BitKeeper/etc/ignore | 3 ++- .../drivers/xen/blkfront/blkfront.c | 23 +++++++++++++++++++ tools/libxc/xc_linux_restore.c | 3 ++- tools/libxc/xc_linux_save.c | 2 +- 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/BitKeeper/etc/ignore b/BitKeeper/etc/ignore index 8ad837b7f0..c548c71cca 100644 --- a/BitKeeper/etc/ignore +++ b/BitKeeper/etc/ignore @@ -16,9 +16,11 @@ docs/*.aux docs/*.log docs/*.pdf docs/*.ps +docs/*.dvi docs/*.toc docs/interface/* docs/user/* +docs/xend/* extras/mini-os/h/hypervisor-ifs install install/* @@ -51,4 +53,3 @@ xen/tools/figlet/figlet xen/xen xen/xen-syms xen/xen.* -xen/common/sched_atropos.c.smh diff --git a/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c b/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c index 848b940b2e..59f5e12d68 100644 --- a/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c +++ b/linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c @@ -303,6 +303,26 @@ static void kick_pending_request_queues(void) } +/* Upon block read completion, issue a dummy machphys update for the +pages in the buffer, just in case we're being migrated. */ + +static void blkif_read_completion(struct request *req) +{ + struct bio *bio; + struct bio_vec *bvec; + int idx; + unsigned long mfn, pfn + + rq_for_each_bio(bio, req) { + bio_for_each_segment(bvec, bio, idx) { + mfn = page_to_phys(bvec->bv_page)>>PAGE_SHIFT; + pfn = machine_to_phys_mapping[mfn]; + queue_machphys_update(mfn, pfn); + } + } +} + + static irqreturn_t blkif_int(int irq, void *dev_id, struct pt_regs *ptregs) { struct request *req; @@ -334,6 +354,9 @@ static irqreturn_t blkif_int(int irq, void *dev_id, struct pt_regs *ptregs) BUG(); end_that_request_last(req); + + if( bret->operation == BLKIF_OP_READ ) + blkif_read_completion( req ); break; case BLKIF_OP_PROBE: memcpy(&blkif_control_rsp, bret, sizeof(*bret)); diff --git a/tools/libxc/xc_linux_restore.c b/tools/libxc/xc_linux_restore.c index f091914dba..db21621e55 100644 --- a/tools/libxc/xc_linux_restore.c +++ b/tools/libxc/xc_linux_restore.c @@ -214,7 +214,8 @@ int xc_linux_restore(int xc_handle, XcIOContext *ioctxt) if ( xc_domain_setinitialmem(xc_handle, dom, nr_pfns * (PAGE_SIZE / 1024)) ) { - xcio_error(ioctxt, "Could not set domain initial memory"); + xcio_error(ioctxt, "Could not set domain %d initial memory. pfns=%d, %dKB", + dom, nr_pfns,nr_pfns * (PAGE_SIZE / 1024)); goto out; } diff --git a/tools/libxc/xc_linux_save.c b/tools/libxc/xc_linux_save.c index 26abf632ae..c2482ef2b1 100644 --- a/tools/libxc/xc_linux_save.c +++ b/tools/libxc/xc_linux_save.c @@ -632,7 +632,7 @@ int xc_linux_save(int xc_handle, XcIOContext *ioctxt) pfn_batch[batch] = n; pfn_type[batch] = live_pfn_to_mfn_table[n]; - if( pfn_type[batch] == 0x80000004 ){ + if( pfn_type[batch] == 0x80000001 ){ /* not currently in pusedo-physical map -- set bit in to_fix that we must send this page in last_iter unless its sent sooner anyhow */ -- 2.30.2